<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="java.util.*, pl.edu.agh.bd2.domain.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>New grade</title>
</head>
<body>
	<center>
		<h1>Grade</h1>
		<form action="/webRegister/newGradeServlet.do" method="post">
			<table width="400px">
				<select name="selectedGradeType" size="10">
					<%Set<Subject> subjects = (HashSet<Subject>)session.getAttribute("subjects");
					for(Subject subject : subjects){
						if(subject.getName().equals((String)session.getAttribute("selectedSubject"))){
							for(GradeType gt : subject.getGradeTypes()){						
					%>
						<option><%=gt.getName()%></option>
					<%		}
							break;
						} 
					}%>	
				</select>
				
				<tr><td width="200px">Grade</td><td width="200px"><input type="text" name="grade" /></td></tr>
				
				<tr><td colspan="2"><input type="submit" id="newGrade" value="add"/></td></tr>
			</table>
		</form>
	</center>
</body>
</html>